import { axios } from '@/utils/request'

/**
 * api接口列表
 */
const api = {
  add: '/order.build/create',
  users: '/order.build/fetch_user',
  addresses: '/order.build/address',
  services: '/order.build/fetch_service',
  skus: '/order.build/fetch_service_sku',
  proficients: '/order.build/fetch_proficient'
}

/**
 * 搜索用户
 * @param {*} data
 */
export function fetchUser (data) {
  return axios({
    url: api.users,
    method: 'post',
    data
  })
}

/**
 * 分店地址
 * @param {*} data
 */
export function addresses (data) {
  return axios({
    url: api.addresses,
    method: 'post',
    data
  })
}

/**
 * 服务列表
 * @param {*} data
 */
export function services (data) {
  return axios({
    url: api.services,
    method: 'post',
    data
  })
}

/**
 * 多规格商品
 * @param {*} data
 */
export function skus (data) {
  return axios({
    url: api.skus,
    method: 'post',
    data
  })
}

/**
 * 技师
 * @param {*} data
 */
export function proficients (data) {
  return axios({
    url: api.proficients,
    method: 'post',
    data
  })
}

/**
 * 技师
 * @param {*} data
 */
export function add (data) {
  return axios({
    url: api.add,
    method: 'post',
    data
  })
}
